import React,{useReducer,useEffect} from 'react'
import {initState,actions,reducer,getCheckAll,getShopList} from '../reducer'
export default function ShopBottom(props) {
    const [state, dispatch] = useReducer(reducer,initState)
    useEffect(() => {
        
    }, [getCheckAll(state)])
    let checkedAll= ()=>{
        dispatch(actions.changeCheckAll(!getCheckAll(state)))

    }
    return (
        <div>
            <div className="foot">
                <div className="foot_l">
                    <input
                        type="checkbox"
                        name=""
                        id="footchecked"
                        defaultChecked={getCheckAll(state)}
                        onChange={()=>checkedAll()}
                    />
                    <label htmlFor="footchecked">全选</label>
                </div>
                <div className="sum">
                    <span style={{ fontSize: "0.25rem", fontWeight: "600" }}>合计</span>
                    <span>已免运费</span>
                </div>
                <div className="f_price">￥123</div>
                <div className="end">结算</div>
            </div>
        </div>
    )
}
